package managers.messengerManager.services;

import managers.messengerManager.MessengerManager;

public abstract class Service extends Thread {

	protected static final int DEFAULT_BASE_WAIT_TIME = 2000;
	protected Object externalObject;
	protected MessengerManager manager = MessengerManager.getSharedInstance();
	
	public Service(String name, int priority) {
		setName(name);
		setPriority(priority);
	}
	
	public Service(String name) {
		this(name, Thread.NORM_PRIORITY);
	}

	public Service(String name, boolean daemon) {
		setName(name);
		setDaemon(daemon);
	}


	public synchronized void wakeUp(Object obj) {
		externalObject = obj;
		notify();
	}
	
	public Object getExternalObject () {
		return externalObject;
	}
}
